package customview.ike.com.customviewproject;

import android.content.Context;
import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Toast;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;

import customview.ike.com.customviewproject.FixBug.FixBugManager;
import customview.ike.com.customviewproject.FixBug.FixDexManager;
import customview.ike.com.customviewproject.fixutils.FixDexUtils;
import openGl.Table;

/**
 * Created by Administrator on 2018/1/17.
 */

public class FixBugActivity extends AppCompatActivity {
    private FixBugManager manager;
    private FixDexManager fixManager;
    private String Tag="FixBugActivity";
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fix_bug);
        manager=new FixBugManager(this);
        String fixPath= Environment.getExternalStorageDirectory().getAbsolutePath()+"/classes15.dex";
        Log.e(Tag,"fixPath:"+fixPath);
        String fixPath2= Environment.getExternalStorageDirectory().getAbsolutePath()+"/fix2.dex";
        try {
            manager.fixDex(fixPath);
            Log.e(Tag,"修复成功:");
        } catch (Exception e) {
            e.printStackTrace();
            Log.e(Tag,"修复失败:"+e.getMessage());
        }

    }
    public void fix_test(View view){
       Toast.makeText(this,2/0+"修复bug测试",Toast.LENGTH_SHORT).show();
       //Toast.makeText(this,"修复bug测试",Toast.LENGTH_SHORT).show();
    }
    
}
